/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ifs.RnD.revisionRead;

import javax.print.DocFlavor.STRING;

/**
 *
 * @author anaklk
 */
public class RevRecord {

    private String recordUrl;
    private char operation;
    private long revisionNO;
    private RevRecord copyComponent;

    /**
     * with this we create objects for the revision records that we access from the repository
     * @param recordUrl
     * @param revisionNO
     */
    public RevRecord(String recordUrl, long revisionNO) {
        this.recordUrl = recordUrl;
        this.revisionNO = revisionNO;
    }

    /**
     * with this we create objects for the revision records that we access from the repository
     * @param recordUrl
     * @param operation
     */
    public RevRecord(String recordUrl, char operation) {
        this.recordUrl = recordUrl;
        this.operation = operation;
    }

    /**
     * with this we create objects for the revision records that we access from the repository
     * @param recordUrl
     * @param operation
     * @param copyComp
     */
    public RevRecord(String recordUrl, char operation, RevRecord copyComp) {
        this.recordUrl = recordUrl;
        this.operation = operation;
        this.copyComponent = copyComp;
    }

    /**
     * This will return the char value of the operation
     * @return
     */
    public char getOperation() {
        return operation;
    }

    /**
     * This will return the URL of the revision record
     * @return
     */
    public String getRecordUrl() {
        return recordUrl;
    }

    /**
     * This will return the revision number
     * @return
     */
    public String getRevisionNO() {
        return "" + revisionNO;
    }

    /**
     * This will return the copy component revisionRecord
     * @return copy component revisionRecord
     */
    public RevRecord getCopyComponent() {
        return copyComponent;
    }

    /**
     * This will set the copy component revisionRecord
     * @param copy component revisionRecord
     */
    public void setCopyComponent(RevRecord copyComponent) {
        this.copyComponent = copyComponent;
    }

    /**
     * This will return the boolean value of comparison between two URL's
     * @param recUrl
     * @return comparison between two URL's
     */
    public boolean containsRecordUrl(String recUrl) {
        return this.recordUrl.equalsIgnoreCase(recUrl);
    }
}
